home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
new_file
/
games
/
csb_port
/
csb_port.lst
< prev
Wrap
File List
|
1995-04-25
|
2KB
|
84 lines
REM ***************************************************************
REM * *
REM * Public Domain Chaos Strikes Back portrait loader. *
REM * *
REM * by Devin Balkcom *
REM * Created with GFA Basic 3.5e *
REM * *
REM * --> Insert CSB Utility disk before proceeding! *
REM * *
REM ***************************************************************
'
@get_palette(old_palette$) ! Get old palette
@dm_palette ! Set to Dungeon Master palette
'
DIR "a:\portrait\" TO "d:\temp.lst" ! This is a buffer
DIM character$(1000) ! d:\temp.lst could
OPEN "I",#1,"d:\temp.lst" ! be any file.
i=0
REPEAT
INC i
INPUT #1,character$(i)
@load_portrait(character$(i))
BOX 0,0,33,30
PUT 1,1,portrait$
LOCATE 1,16
PRINT nickname$+SPACE$(8)
PRINT title$+SPACE$(20)
a=INP(2)
UNTIL EOF(#1)
CLOSE #1
'
KILL "d:\temp.lst" ! Get rid of buffer
@set_palette(old_palette$) ! Restore palette
'
> PROCEDURE load_portrait(name$)
OPEN "I",#99,"a:\portrait\"+name$
SEEK #99,16
nickname$=INPUT$(8,#99)
title$=INPUT$(20,#99)
SEEK #99,44
portrait$=INPUT$(464,#99)
portrait2$=SPACE$(470)
DPOKE V:portrait2$,31
DPOKE V:portrait2$+2,28
DPOKE V:portrait2$+4,4
BMOVE V:portrait$,V:portrait2$+6,464
portrait$=portrait2$
CLOSE #99
RETURN
> PROCEDURE dm_palette
RESTORE palette
FOR i=0 TO 15
READ r,g,b
SETCOLOR i,r,g,b
DEFFILL i,1,1
NEXT i
palette:
DATA 0,0,0
DATA 3,3,3
DATA 4,4,4
DATA 3,1,0
DATA 0,6,6
DATA 4,2,0
DATA 0,4,0
DATA 0,6,0
DATA 7,0,0
DATA 7,5,0
DATA 6,4,3
DATA 7,7,0
DATA 2,2,2
DATA 5,5,5
DATA 0,0,7
DATA 7,7,7
RETURN
> PROCEDURE get_pallette(VAR palette$)
palette$=""
FOR i=0 TO 15
palette$=palette$+MKI$(XBIOS(7,i,-1))
NEXT i
RETURN
> PROCEDURE set_palette(palette$)
~XBIOS(6,L:V:palette$)
RETURN